package com.zzh.wsss.mapper;

import com.zzh.wsss.pojo.PunchClock;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PunchClockOperateMapper {

    @Select("select count(*) from punch_clock where user_id=#{userId} and job_id=#{jobId} and flag=#{flag}")
    Integer getPunchClockNum(@Param("userId") Integer userId,@Param("jobId") Integer jobId,@Param("flag") int i);

    @Insert("insert into punch_clock (user_id,job_id,flag,job_time) values (#{userId},#{jobId},#{flag},#{jobTime})")
    void addPunchClock(@Param("userId") Integer userId,@Param("jobId")  Integer userJobId,
                       @Param("flag") int i,@Param("jobTime")  String toString);

    @Select("select * from punch_clock where user_id=#{userId} and job_id=#{jobId}")
    List<PunchClock> getPunchClocks(@Param("userId") Integer userId,@Param("jobId") Integer jobId);
}
